Skip to content

feat(react-headless-components-preview): add headless MenuButton#36320

Open
mainframev wants to merge 4 commits into
microsoft:masterfrom
mainframev:feat/headless-menu-button
Open

feat(react-headless-components-preview): add headless MenuButton#36320
mainframev wants to merge 4 commits into
microsoft:masterfrom
mainframev:feat/headless-menu-button

Conversation

@mainframev

@mainframev mainframev commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a headless, unstyled MenuButton to @fluentui/react-headless-components-preview, following the same pattern as the existing headless Button and ToggleButton: it consumes useMenuButtonBase_unstable from @fluentui/react-button and adds data-* styling-hook attributes, re-exporting the shared renderMenuButton_unstable.

⚠️ Stacked on #36319 (the react-button base hook). This PR is a Draft until #36319 merges. Until then its diff also shows the react-button changes from #36319 — once that lands I'll rebase this branch onto master, leaving only the headless additions below.

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-button
MenuButton
37.584 kB
9.898 kB
37.588 kB
9.892 kB
4 B
-6 B
react-button
SplitButton
46.383 kB
11.555 kB
46.556 kB
11.533 kB
173 B
-22 B
react-charts
AreaChart
404.322 kB
126.056 kB
404.498 kB
126.128 kB
176 B
72 B
react-charts
DeclarativeChart
755.323 kB
220.437 kB
755.499 kB
220.495 kB
176 B
58 B
react-charts
DonutChart
314.785 kB
96.812 kB
314.961 kB
96.878 kB
176 B
66 B
react-charts
FunnelChart
306.284 kB
93.624 kB
306.46 kB
93.69 kB
176 B
66 B
react-charts
GanttChart
387.422 kB
120.42 kB
387.595 kB
120.492 kB
173 B
72 B
react-charts
GaugeChart
314.163 kB
96.187 kB
314.339 kB
96.25 kB
176 B
63 B
react-charts
GroupedVerticalBarChart
395.293 kB
123.143 kB
395.467 kB
123.213 kB
174 B
70 B
react-charts
HeatMapChart
389.498 kB
121.461 kB
389.674 kB
121.531 kB
176 B
70 B
react-charts
HorizontalBarChart
294.457 kB
89.29 kB
294.633 kB
89.357 kB
176 B
67 B
react-charts
Legends
234.137 kB
70.117 kB
234.31 kB
70.189 kB
173 B
72 B
react-charts
LineChart
415.652 kB
129.018 kB
415.826 kB
129.097 kB
174 B
79 B
react-charts
PolarChart
343.136 kB
106.676 kB
343.31 kB
106.743 kB
174 B
67 B
react-charts
ScatterChart
395.035 kB
123.149 kB
395.209 kB
123.217 kB
174 B
68 B
react-charts
VerticalBarChart
431.773 kB
128.084 kB
431.947 kB
128.17 kB
174 B
86 B
react-charts
VerticalStackedBarChart
401.497 kB
124.578 kB
401.671 kB
124.635 kB
174 B
57 B
react-components
react-components: entire library
1.296 MB
325.535 kB
1.296 MB
325.606 kB
174 B
71 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-breadcrumb
@fluentui/react-breadcrumb - package
102.926 kB
28.76 kB
react-button
Button
32.684 kB
8.504 kB
react-button
CompoundButton
39.562 kB
9.861 kB
react-button
ToggleButton
52.344 kB
10.635 kB
react-card
Card - All
93.06 kB
26.955 kB
react-card
Card
85.658 kB
25.044 kB
react-card
CardFooter
11.516 kB
4.606 kB
react-card
CardHeader
14.047 kB
5.435 kB
react-card
CardPreview
11.597 kB
4.716 kB
react-charts
HorizontalBarChartWithAxis
63 B
83 B
react-charts
SankeyChart
211.914 kB
67.836 kB
react-charts
Sparkline
80.503 kB
26.644 kB
react-components
react-components: Button, FluentProvider & webLightTheme
66.328 kB
19.02 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
226.531 kB
68.074 kB
react-components
react-components: FluentProvider & webLightTheme
39.525 kB
13.113 kB
react-dialog
Dialog (including children components)
90.204 kB
27.895 kB
react-headless-components-preview
react-headless-components-preview: entire library
248.42 kB
71.443 kB
react-message-bar
MessageBar (all components)
22.306 kB
8.184 kB
react-portal-compat
PortalCompatProvider
5.567 kB
2.237 kB
react-tag-picker
@fluentui/react-tag-picker - package
174.152 kB
54.127 kB
react-teaching-popover
TeachingPopover
101.1 kB
31.859 kB
react-timepicker-compat
TimePicker
141.076 kB
46.036 kB
react-tree
FlatTree
135.901 kB
40.452 kB
react-tree
PersonaFlatTree
137.729 kB
40.967 kB
react-tree
PersonaTree
133.79 kB
39.741 kB
react-tree
Tree
131.968 kB
39.256 kB
🤖 This report was generated against c54070db5b3d11b2bb566a2cbaa45b4cf95bf03a

@github-actions

Copy link
Copy Markdown

Pull request demo site: URL

@mainframev mainframev self-assigned this Jun 17, 2026
@mainframev mainframev force-pushed the feat/headless-menu-button branch 4 times, most recently from 3cdf9c2 to 30449c8 Compare June 17, 2026 21:13
…utton

feat(react-button): export useMenuButtonBase_unstable and base types

feat(react-headless-components-preview): add headless MenuButton

feat(react-headless-components-preview): MenuButton api report and change file
@mainframev mainframev force-pushed the feat/headless-menu-button branch from 30449c8 to 7a064fa Compare June 17, 2026 21:16
@@ -0,0 +1,7 @@
{

@github-actions github-actions Bot Jun 17, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵🏾‍♀️ visual changes to review in the Visual Change Report

vr-tests-react-components/Avatar Converged 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Avatar Converged.badgeMask.normal.chromium.png 5 Changed
vr-tests-react-components/Positioning 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png 618 Changed
vr-tests-react-components/Positioning.Positioning end.chromium.png 731 Changed
vr-tests-react-components/ProgressBar converged 3 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - Dark Mode.default.chromium.png 31 Changed
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - High Contrast.default.chromium.png 170 Changed
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness.default.chromium.png 69 Changed
vr-tests-react-components/Skeleton converged 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Skeleton converged.Opaque Skeleton with rectangle - Dark Mode.default.chromium.png 15 Changed
vr-tests-react-components/TagPicker 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/TagPicker.disabled - Dark Mode.disabled input hover.chromium.png 658 Changed

There were 1 duplicate changes discarded. Check the build logs for more information.

@mainframev mainframev marked this pull request as ready for review June 18, 2026 11:55
@mainframev mainframev requested a review from a team as a code owner June 18, 2026 11:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new headless, unstyled MenuButton surface to @fluentui/react-headless-components-preview, built on top of a new useMenuButtonBase_unstable base hook in @fluentui/react-button (this PR is currently stacked on #36319 per the description).

Changes:

  • Add headless MenuButton implementation, exports, stories, and API report for @fluentui/react-headless-components-preview/menu-button.
  • Add useMenuButtonBase_unstable + base types in @fluentui/react-button, and widen renderMenuButton_unstable to accept MenuButtonBaseState.
  • Add tests and beachball change files for both packages.

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/react-components/react-headless-components-preview/stories/src/MenuButton/MenuButtonWithIcon.stories.tsx Adds icon + icon-only story variants for headless MenuButton.
packages/react-components/react-headless-components-preview/stories/src/MenuButton/MenuButtonSize.stories.tsx Adds size styling examples for headless MenuButton.
packages/react-components/react-headless-components-preview/stories/src/MenuButton/MenuButtonDisabled.stories.tsx Adds disabled/disabledFocusable examples for headless MenuButton.
packages/react-components/react-headless-components-preview/stories/src/MenuButton/MenuButtonDescription.md Adds docs description for the new headless MenuButton stories page.
packages/react-components/react-headless-components-preview/stories/src/MenuButton/MenuButtonDefault.stories.tsx Adds default usage story (as Menu trigger).
packages/react-components/react-headless-components-preview/stories/src/MenuButton/MenuButtonAppearance.stories.tsx Adds appearance styling examples (primary/secondary/subtle/outline) via CSS classes.
packages/react-components/react-headless-components-preview/stories/src/MenuButton/menu-button.module.css Adds story-only styling using CSS variables and data-* hooks.
packages/react-components/react-headless-components-preview/stories/src/MenuButton/index.stories.tsx Registers MenuButton stories under Components/MenuButton.
packages/react-components/react-headless-components-preview/library/src/menu-button.ts Adds the package entrypoint re-export for menu-button subpath.
packages/react-components/react-headless-components-preview/library/src/components/MenuButton/useMenuButton.ts Implements headless useMenuButton wrapper to add data-* styling hooks.
packages/react-components/react-headless-components-preview/library/src/components/MenuButton/renderMenuButton.ts Re-exports shared renderMenuButton_unstable from @fluentui/react-button.
packages/react-components/react-headless-components-preview/library/src/components/MenuButton/MenuButton.types.ts Defines headless MenuButtonState augmentation and re-exports props/slots.
packages/react-components/react-headless-components-preview/library/src/components/MenuButton/MenuButton.tsx Adds headless MenuButton component wrapper (ForwardRefComponent).
packages/react-components/react-headless-components-preview/library/src/components/MenuButton/MenuButton.test.tsx Adds headless component conformance + basic rendering/state tests.
packages/react-components/react-headless-components-preview/library/src/components/MenuButton/index.ts Adds component-level barrel exports for headless MenuButton.
packages/react-components/react-headless-components-preview/library/package.json Adds "./menu-button" export map entry.
packages/react-components/react-headless-components-preview/library/etc/menu-button.api.md Adds API Extractor report output for the new headless menu-button entrypoint.
packages/react-components/react-button/library/src/MenuButton.ts Re-exports new base hook + base types for public consumption.
packages/react-components/react-button/library/src/index.ts Adds new base hook + base types exports at package root.
packages/react-components/react-button/library/src/components/MenuButton/useMenuButtonBase.test.tsx Adds unit tests for useMenuButtonBase_unstable.
packages/react-components/react-button/library/src/components/MenuButton/useMenuButton.tsx Implements useMenuButtonBase_unstable and refactors useMenuButton_unstable to build on it.
packages/react-components/react-button/library/src/components/MenuButton/renderMenuButton.tsx Widens render signature from styled state to base state.
packages/react-components/react-button/library/src/components/MenuButton/MenuButton.types.ts Adds MenuButtonBaseProps/MenuButtonBaseState for headless composition.
packages/react-components/react-button/library/src/components/MenuButton/index.ts Exports new base hook + base types from component barrel.
packages/react-components/react-button/library/etc/react-button.api.md Updates public API report for new base hook/types and widened render signature.
change/@fluentui-react-headless-components-preview-7246c651-b258-4694-b0e7-45b666b15aae.json Adds beachball change entry for headless MenuButton.
change/@fluentui-react-button-3e45fb7a-a8fa-4902-a694-fa9b89a68fd1.json Adds beachball change entry for new useMenuButtonBase_unstable.

mainframev and others added 2 commits June 18, 2026 23:55
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@mainframev mainframev force-pushed the feat/headless-menu-button branch from 43c60bc to bbae420 Compare June 19, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants